package com.framework.service.core.converter;

import com.framework.service.core.dao.model.ThirdUserInfo;
import com.framework.core.api.response.WxUserInfo;
import com.framework.service.core.dao.model.ThirdUserInfo;

/**
 * @author zhoubb
 * @version V1.0
 * @Date 2020/4/15 23:36
 * @since JDK 1.8
 */
public class ThirdUserInfoConverter {

    /**
     * 微信用户转换成第三方用户
     * @param wxUserInfo
     * @return
     */
    public  static ThirdUserInfo wxUserToThirdUser(WxUserInfo wxUserInfo) {
        ThirdUserInfo thirdUserInfo = new ThirdUserInfo();
        thirdUserInfo.setGender(Integer.valueOf(wxUserInfo.getSex()));
        thirdUserInfo.setNickName(wxUserInfo.getNickname());
        thirdUserInfo.setOpenId(wxUserInfo.getOpenid());
        thirdUserInfo.setUnionId(wxUserInfo.getUnionid());
        return thirdUserInfo;
    }
}
